<template functional>
  <el-row class="detail">
    <el-col class="detail-content">
      <el-row type="flex">
        <el-col :span="8" class="detail-content-item">
          <img
            src="https://shadow.elemecdn.com/app/element/hamburger.9cf7b091-55e9-11e9-a976-7f4d0b07eef6.png"
            width="106px"
            class="image"
          />
          <div class="company-info">
            <div class="company-info-main">{{props.detailInfo.companyTitle}}</div>
            <div class="company-info-sub">
              <div class="company-info-sub-tags" v-if="props.detailInfo.tag">
                <el-tag
                  class="tag-item"
                  v-for="item in props.detailInfo.tagList"
                  :key="item.content"
                  :type="item.color"
                >{{item.content}}</el-tag>
              </div>
              <div v-else class="company-info-sub-title">{{props.detailInfo.subTitle}}</div>
            </div>
          </div>
        </el-col>
        <el-col :span="4" class="detail-content-item" v-if="props.detailInfo.cost">
          <el-row>
            <el-col class="detail-content-info">出价</el-col>
            <el-col
              class="detail-content-value detail-content-value--red"
            >¥{{(props.detailInfo.cost + "").replace(/(\d{1,3})(?=(\d{3})+(?:$|\.))/g, '$1,')}}</el-col>
          </el-row>
        </el-col>
        <el-col :span="4" class="detail-content-item" v-if="props.detailInfo.range.length">
          <el-row>
            <el-col class="detail-content-info">出价预算</el-col>
            <el-col
              class="detail-content-value"
            >¥{{(props.detailInfo.range[0] + "").replace(/(\d{1,3})(?=(\d{3})+(?:$|\.))/g, '$1,')}}~{{(props.detailInfo.range[1] + "").replace(/(\d{1,3})(?=(\d{3})+(?:$|\.))/g, '$1,')}}</el-col>
          </el-row>
        </el-col>
        <el-col :span="4" class="detail-content-item" v-if="props.options.earlyTime">
          <el-row>
            <el-col class="detail-content-info">最早交货</el-col>
            <el-col class="detail-content-value">{{props.detailInfo.earlyTime}}</el-col>
          </el-row>
        </el-col>
        <el-col :span="4" class="detail-content-item" v-if="props.options.preDeliverTime">
          <el-row>
            <el-col class="detail-content-info">期望交货时间</el-col>
            <el-col class="detail-content-value">{{props.detailInfo.preDeliverTime}}</el-col>
          </el-row>
        </el-col>
        <el-col :span="8" class="detail-content-item" v-if="$slots.button">
          <slot name="button"></slot>
        </el-col>
      </el-row>
    </el-col>
  </el-row>
</template>
<style lang="scss" scoped>
.detail {
  &-title {
    height: 96px;
    background: #fafaff;
    border: 1px solid #dbe1f6;
    padding: 20px;

    &-main {
      font-size: 18px;
      font-weight: 600;
      color: #3b3b3b;
      margin-bottom: 10px;
    }

    &-sub {
      font-size: 14px;
      font-weight: 400;
      color: #b3b3b3;
    }
  }

  &-content {
    height: 146px;
    background: #ffffff;
    border: 1px solid #e6e6e6;
    padding: 20px 0;

    &-item {
      padding: 0 20px;
      border-left: 1px solid #e6e6e6;

      &:first-of-type {
        border-left: none;
        display: flex;
      }

      .company-info {
        display: inline-block;
        vertical-align: top;

        &-main {
          font-size: 14px;
          font-weight: 600;
          color: #4d4d4d;
        }

        &-sub {
          .tag-item {
            margin-right: 10px;
          }

          &-title {
            margin-top: 5px;
            font-size: 14px;
            font-weight: 400;
            color: #b3b3b3;
          }
        }
      }
    }

    .image {
      padding-right: 20px;
    }

    &-info {
      font-size: 14px;
      font-weight: 500;
      color: #b3b3b3;
      margin-bottom: 20px;
    }

    &-value {
      font-size: 24px;
      font-weight: 600;

      &--red {
        color: #f66f6a;
      }
    }
  }
}
</style>